package test_package;

import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

import java.util.concurrent.TimeUnit;

/**
 * Created by iryna on 3/29/14.
 */
public class RezetkaTestPage {
    private FirefoxDriver driver;

    @BeforeTest
    public void setUp(){
        driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        driver.get("http://rozetka.com.ua/");
    }

    @AfterTest
    public void tearDown(){
        driver.close();
    }




    @Test
    public void testSearch(){
    //Rezetka Home page
        HomePage home = new HomePage(driver);
        ResultPage result = home.search("ipad");

        Assert.assertTrue(result.getFirstLink().contains("iPad"));

        //WebElement resultlink = driver.findElement(By.partialLinkText("Планшет"));
        //Assert.assertEquals(true, resultlink.isDisplayed());



    }

}
